import request from '@/utils/request'

// 部件类型表

/**
 * 获取列表
 *
 * @export
 * @param {*} data { keyword }
 * @returns
 */
export function fetchComponentTypeFindPage(data) {
  return request({
    url: '/pc/base/componentType/findPage',
    method: 'post',
    data
  })
}

/**
 * 获取详情
 *
 * @export
 * @param {*} params { id }
 * @returns
 */
export function fetchComponentTypeGet(params) {
  return request({
    url: '/pc/base/componentType/get',
    method: 'get',
    params
  })
}

/**
 * 添加
 *
 * @export
 * @param {*} data { typeName, markType, icon, enabled }
 * @returns
 */
export function fetchComponentTypeAdd(data) {
  return request({
    url: '/pc/base/componentType/add',
    method: 'post',
    data
  })
}

/**
 * 更新
 *
 * @export
 * @param {*} data { typeName, markType, icon, enabled }
 * @returns
 */
export function fetchComponentTypeUpdate(data) {
  return request({
    url: '/pc/base/componentType/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchComponentTypeDelete(params) {
  return request({
    url: '/pc/base/componentType/delete',
    method: 'post',
    params
  })
}

/**
 * 更新状态
 *
 * @export
 * @param {*} params { enabled, id }
 * @returns
 */
export function fetchComponentTypeUpdateStatus(params) {
  return request({
    url: '/pc/base/componentType/updateStatus',
    method: 'post',
    params
  })
}
